<template>
  <div>
	<van-sticky :offset-top="1">
	  <header id="header" class="aui-bar aui-bar-nav">
	      <a class="aui-pull-left" @click="fnStateList">
	          <span class="iconfont icon-fanhui"></span>
	      </a>
	      <div class="aui-title">添加买号</div>
	  </header>
	</van-sticky>
    <van-tabs v-model="active" :swipeable="true" >
      <van-tab :title="item.title" v-for="(item, index) in items" :key="index" :title-style="{'flex': '0 0 25%!important'}">
        <User :type="item.type"></User>
      </van-tab>
    </van-tabs>
  </div>
</template>

<script>
  import User from "./components/user";
  export default {
    components: {
		User
    },
    mounted() {
      this.active = this.$route.query.type ?  this.items.findIndex(item => item.title == this.$route.query.name) : 0;
    },
    data () {
      return {
        active: 0,
        items: [
          {type: 1,title: '淘宝天猫阿里'},
          {type: 2,title: '京东'},
          {type: 3,title: '拼多多'},
          {type: 6,title: '拼多多商家版'},
          {type: 4,title: '抖音'},
          {type: 5,title: '快手'},
        ]
      }
    },
	methods: {
		fnStateList () {
			this.utils.fnOpenCommon(this, {name: 'account'})
		}
	}
  }
</script>
